{include file="public/header" /}
<body>
<style>
    .cion{
        display: inline-block;
        width: 120px;
    }
</style>
<div class="page-container">
    <form  method="get" action="">
        <div class="text-c">
            日期范围：
            <input type="text" onfocus="WdatePicker()" value="{:input('get.start')}" name="start" id="datemin" class="input-text Wdate" style="width:120px;" autocomplete="off">
            -
            <input type="text" onfocus="WdatePicker()" value="{:input('get.end')}" name="end" id="datemax" class="input-text Wdate" style="width:120px;" autocomplete="off">
            <input type="text" class="input-text" style="width:250px" placeholder="ID/账号" value="{:input('word')}" name="word">
            <!--<span class="select-box" style="width: 100px;">-->
            <!--<select name="type" class="select">-->
            <!--<option value="-1">类型</option>-->
            <!--<option value="1" {if isset($_GET['type']) && $_GET['type'] == 1}selected{/if}>代理商</option>-->
            <!--<option value="2" {if isset($_GET['type']) && $_GET['type'] == 2}selected{/if}>商户</option>-->
            <!--</select>-->
            <!--</span>-->
            <span class="select-box" style="width: 100px;">
                <select name="parent" class="select">
                    <option value="0">所有二级代理商</option>
                    {foreach $ps as $v}
                        {if isset($_GET['parent']) && $v.id ==  $_GET['parent']}
                        <option value="{$v.id}" selected>{$v.nickname}</option>
                        {else/}
                        <option value="{$v.id}">{$v.nickname}</option>
                        {/if}
                    {/foreach}
                </select>
            </span>
            <button type="submit" class="btn btn-success">搜索</button>
        </div>
    </form>

    <div class="cl pd-5 bg-1 bk-gray mt-20">
         <span class="l">
            <a href="javascript:;" onclick="layopen('新增商户','{:url('shopEdit')}',800,600)" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i>新增商户</a>
        </span>
        <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="12">商户列表</th>
        </tr>
        <tr class="text-c">
            <th width="70">标识</th>
            <th width="100">账号</th>
            <th width="120">昵称</th>
            <th width="100">分红比例</th>
            <th width="20">类型</th>
            <th width="100">二级代理商</th>
            <th width="100">时间</th>
            <th width="50">余额</th>
            <th width="60">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $list as $v}
        <tr class="text-c">
            <td class="text-l">{$v.id}</td>
            <td class="text-l">{$v.username}</td>
            <td class="text-l">{$v.nickname}</td>
            <td class="text-l">{$v.bonus}</td>
            <td>
                {switch name="$v.type"}
                {case value="1"} <font color="red">一级代理商</font>{/case}
                {case value="2"}<font color="red">二级代理商</font>{/case}
                {default /}<font color="green">商户</font>
                {/switch}
            </td>
            <td>
                {$v.p_name}
            </td>
            <td class="text-l">{:date('Y-m-d H:i:s',$v['time'])}</td>
            <td class="text-l">{$v.money}</td>
            <td>
                <a class="btn-link" title="编辑" href="javascript:;" onclick="layopen('编辑','{:url('shopEdit',['id'=>$v.id])}')">编辑</a>
                <a class="btn-link" title="派卡" href="javascript:;" onclick="layopen('编辑','{:url('shopCard',['id'=>$v.id])}')">派卡</a>
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    <div class="page">
        {$list->render()|raw}
    </div>
</div>

{include file="public/footer" /}

<script type="text/javascript">


</script>